import Vue from 'vue'
import VueRouter from 'vue-router'
// 首页
import JikeHome from '@/views/JikeHome'
// 问答
import JikeQuestion from '@/views/JikeQuestion'
// 视频
import JikeVideo from '@/views/JikeVideo'
// 用户
import JikeUser from '@/views/JikeUser'
// 文章详情
import JikeArticle from '@/views/JikeArticle'
// 公共组件
import Tabbar from '@/components/app-tabbar.vue'
// 登录组件
import JikeLogin from '@/views/JikeLogin'
// 用户资料
// import UserProfile from '@/components/UserProfile'

// 小智同学
// import UserChat from '@/components/UserChat'

Vue.use(VueRouter)

const routes = [
  { path: '/', components: { default: JikeHome, content: Tabbar } },
  { path: '/question', components: { default: JikeQuestion, content: Tabbar } },
  { path: '/video', components: { default: JikeVideo, content: Tabbar } },
  { path: '/user', components: { default: JikeUser, content: Tabbar } },
  { path: '/article', component: JikeArticle },
  { path: '/login', component: JikeLogin }
  // 嵌套方法
  // {
  //   path: '/',
  //   component: JikeHome,
  //   children: [
  //     { path: '/', component: Tabbar }
  //   ]
  // },
  // {
  //   path: '/question',
  //   component: JikeQuestion,
  //   children: [
  //     { path: '/', component: Tabbar }
  //   ]
  // },
  // {
  //   path: '/video',
  //   component: JikeVideo,
  //   children: [
  //     { path: '/', component: Tabbar }
  //   ]
  // },
  // {
  //   path: '/user',
  //   component: JikeUser,
  //   children: [
  //     { path: '/', component: Tabbar }
  //   ]
  // },
  // {
  //   path: '/article',
  //   component: JikeArticle,
  //   children: [
  //     { path: '/', component: Tabbar }
  //   ]
  // }
]

const router = new VueRouter({
  routes
})

export default router
